﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MZ.Money.Index" %>

<%@ Register src="../UserControl/Money/TopMenu.ascx" tagname="TopMenu" tagprefix="uc1" %>
<%@ Register src="../UserControl/Money/LeftMenu.ascx" tagname="LeftMenu" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>理财猪手</title>
    <link href="../css/reset-min.css" rel="stylesheet" type="text/css" />
    <link href="../css/base-min.css" rel="stylesheet" type="text/css" />
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/smoothness/jquery-ui-1.8.14.custom.css" rel="stylesheet" type="text/css" />
    <link href="../css/Money.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery-1.6.2.min.js" type="text/javascript"></script>

    <script src="../js/jquery-ui-1.8.14.custom.min.js" type="text/javascript"></script>

    <script src="../js/jquery.price_format.1.5.js" type="text/javascript"></script>

    <style>
        #toolbar
        {
            padding: 10px 4px;
        }
        
        .price_list li
        {
            margin-bottom: 10px;
        }
        .price_list span
        {
            margin-right:10px;
        }
                
        .input_item{ float:left; width:350px; height:30px;line-height:30px;}
    </style>
</head>
<body>
    <div style="width: 960px; margin: 0px auto;">
        <form id="form1" runat="server">
        <uc1:TopMenu ID="TopMenu1" runat="server" />
        
    <div id="work" class="ui-corner-all ui-widget-content">
        <uc1:LeftMenu ID="LeftMenu1" runat="server" />
    
            
            <div style="float:left; padding:20px; width:737px;">
           <div class="input_item">
                    <label>
                        账户</label><asp:DropDownList runat="server" ID="DdlMyCard" DataTextField="Title" DataValueField="CID">
                        </asp:DropDownList>
                </div>
                <div class="input_item">
                    <label>
                        消费类型</label><asp:DropDownList runat="server" ID="DdlMyCategory" DataTextField="Title"
                            DataValueField="ID" AutoPostBack="true" OnSelectedIndexChanged="DdlMyCategory_SelectedIndexChanged">
                        </asp:DropDownList>
                    <asp:DropDownList runat="server" ID="DdlMySubCategory" DataTextField="Title" DataValueField="ID"
                        Visible="false">
                    </asp:DropDownList>
                </div>
                <div class="input_item">
                    <label>
                        时间</label><asp:TextBox runat="server" ID="TxtRecordTime"></asp:TextBox>
                </div>
                <div class="input_item">
                    <label>
                        金额</label><asp:TextBox runat="server" ID="TxtMoney"></asp:TextBox>
                </div>
                <div style="float:left; width:100%; margin-top:5px;">
                    <label>
                        备注</label><asp:TextBox runat="server" ID="TxtRemark" TextMode="MultiLine" Rows="2" Width="80%"></asp:TextBox>
                </div>
                <div class="input_item" style=" margin-top:10px;">
                    <asp:Button runat="server" ID="BtnMoneySubmit" Text="保存" OnClick="BtnMoneySubmit_Click"/><asp:CheckBox runat="server" Text="自动保存"  ID="CbxAuto" style="margin-left:100px"/>
                </div>
            <div style="clear:both;"></div>
           
           
                <hr style="color:#AAAAAA;background-color:#AAAAAA;height:2px;border:none; " />
                <asp:Repeater runat="server" ID="RptList">
            <HeaderTemplate>
                <h2>
                    消费记录摘要</h2>
                <ol class="price_list">
            </HeaderTemplate>
            <FooterTemplate>
                </ol>
            </FooterTemplate>
            <ItemTemplate>
                <li><span>账户：<%#GetCardText(Eval("CardID")) %></span><span>消费类型：<%#GetCategoryText(Eval("CategoryID"))%></span><span>消费金额：<%#Eval("money")%></span><span>消费时间：<%#GetDateString(Eval("CreateTime"))%></span></li>
            </ItemTemplate>
        </asp:Repeater>
            </div>
            <div style="clear:both;"></div>
        </div>
        
        <div id="dialog-message" title="自动记账">
	        <p>
		        系统将定期为你记录此次记账内容。
	        </p>
	        <p>
	        请选择自动记录周期：<asp:DropDownList runat="server" ID="DdlAutoType">
	            <asp:ListItem Text="每天" Value="1"></asp:ListItem><asp:ListItem Text="工作日" Value="2"></asp:ListItem>
	        </asp:DropDownList>    
	        </p>
	        <asp:Button runat="server" ID="BtnAutoSave" Text="保存" OnClick="BtnAutoSave_Click"/>
	        <button id="btnCancel" onclick="$('#dialog-message').dialog('close');return false;">取消</button>
        </div>
        </form>
    </div>
    
    <div id="footerBar" style="margin:30px auto; width:960px;">
		<a target="_blank" href="http://www.zonezu.com/about.html">关于账族</a> | <a target="_blank" href="http://blog.sina.com.cn/zonezu">官方博客</a> | <a target="_blank" href="http://www.zonezu.com/serviceItem.html">服务条款</a> | <a target="_blank" href="http://www.zonezu.com/contact.html">联系我们</a> | <a target="_blank" href="http://www.zonezu.com/help/index.html">帮助中心</a> | <a target="_blank" href="http://www.zonezu.com/link.html">友情链接</a>  
	</div>
	
	 
</body>
</html>

<script>
    $('#dialog-message').dialog({ autoOpen: false,modal: true})
	$('#dialog-message').parent().appendTo($("form:first")); 

	$(function() {
		$("#BtnMoneySubmit").click(function(){
		    if($('#CbxAuto').attr("checked")){
		        $('#dialog-message').dialog("open");
		        return false;
		    }
		    return true;
		})
		
		//toolbar
		$('#btnShowAccount').button().click(function(){
		    $('#cardPanel').dialog('open');
		    return false;   
		});
	
		
		//dialog
		$('#cardPanel').dialog({ autoOpen: false,modal: true,title:'创建账号'})
		$('#cardPanel').parent().appendTo($("form:first")); 
		$('#BtnCreadCard').button();
		
		//datepicker
		$( "#TxtRecordTime" ).datepicker({
			showOn: "button",
			buttonImage: "../img/Calendar-Edit.png",
			buttonImageOnly: true
		});
		
		//button
		$('#BtnMoneySubmit,#BtnAutoSave,#btnCancel').button();
		
		//price input
		$('#TxtCardMoney,#TxtMoney').priceFormat({
		     prefix: 'RMB￥',
		     clearPrefix: true
		});
	});
</script>

